package com.ark.cloud.java.persistence.service.impl;


import com.alibaba.fastjson.JSON;
import com.ark.cloud.java.persistence.entity.JammerEvent;
import com.ark.cloud.java.persistence.mapper.JammerEventMapper;
import com.ark.cloud.java.persistence.service.JammerEventService;
import com.ark.cloud.java.persistence.utils.UUIDUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class JammerEventServiceImpl extends ServiceImpl<JammerEventMapper, JammerEvent> implements JammerEventService {


    @Resource
    private JammerEventMapper jammerEventMapper;

    @Override
    public void saveJammerEvent(JammerEvent jammerEvent) {

        jammerEvent.setId(UUIDUtil.next());
        jammerEvent.setJammeredEntId(jammerEvent.getJammerEntIdList().toString());
        System.out.println("jammerEvent: {}"+ JSON.toJSONString(jammerEvent));

        jammerEventMapper.saveJammerEvent(jammerEvent);


    }


}
